package cn.tedu.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author:努力学java的小雨
 * @创建时间:2021/8/31 15:29
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SysResult implements Serializable {
    private Integer status;
    private String msg;
    private Object data;

    public static SysResult fail(){
        return new SysResult(201, "执行失败", null);
    }

    public static SysResult success(){
        return new SysResult(200, "执行成功", null);
    }

    public static SysResult success(Object data){
        return new SysResult(200, "执行成功", data);
    }

    public static SysResult success(Object data, String msg){
        return new SysResult(200, msg, data);
    }
}
